package net.unix8.process;

import java.util.concurrent.ArrayBlockingQueue;

import net.unix8.bean.Data;

public class ProducerFilter {
    private final ArrayBlockingQueue<Data> queue;  
    
    public ProducerFilter(ArrayBlockingQueue<Data> queue){  
        this.queue = queue;  
    }  
  
   public void clear(){
	   queue.clear();
   }
    public void produce(Data data){  
        try {  
            queue.put(data);  
            //System.out.println("Producer:"+data);  
        } catch (InterruptedException e) {  
            e.printStackTrace();  
        }  
    }
}
